package Uitls;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by Administrator on 2016/7/18.
 */
public class TimeUtil {
    public static Date instance;
    public static Date getInstance() {
        if(instance==null) {
            instance = new Date();
        }
        return instance;
    }

    public static String getStringDate() {
        Date currentTime = new Date();
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String dateString = formatter.format(currentTime);
        return dateString;
    }

    public static String getYearAndMonth() {
        String str = getYearAndMonth();
        return str;
    }
}
